<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

</body>
<script src="./test.js"></script>
<script>
  function getUserId() {
    return new Promise(function (resolve) {
      // 异步请求
      resolve(123)
    });
  }

  getUserId().then(function (id) {
    return new Promise(function (resolve) {
      setTimeout(function () {
        resolve(23123)
      }, 1000)
    })
  }).then(function (value) {
    console.log(value)
  })
</script>
</html>
